const lbbTaskService = require("../service/task-service")

// pkgCost/pages/ldle-table-detail/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        qcode:'Z6547',
        type:'轮椅',
        position:'门诊',
        percentRax:40,
        pileRate:30,
        threeDayNoScan:2,
        threeDayNoRent:2,
        onPileTime:20,
        tableData:[
            {
                equCode:'Z6547',
                equType:'轮椅',
                unScan:'2次'
            },
            {
                equCode:'L6547',
                equType:'手动轮椅',
                unScan:'2次'
            },
        ],
        columns:[
            { title:'设备编号',key:'equId',width:'150rpx' },
            { title:'设备类型',key:'equType',width:'150rpx' },
            { title:'设备闲置率',key:'unUsedRate',width:'150rpx' },
            { title:'3天未扫码',key:'totalUnusedTime',width:'150rpx' },
            { title:'3天未租借',key:'unUsedThreeDayCount',width:'150rpx' },
            { title:'设备在桩时长',key:'unUsedTimes',width:'150rpx' },
            { title:'统计时间',key:'createDate',width:'150rpx' },
        ],
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.setData({
            returnHid:options.returnHid,
            mechanismId:options.mechanismId,
            position:options.position
        })
        this.getInfo()
    },
    getInfo() {
        let  that = this
        lbbTaskService.getUnusedHomingDetail({returnHid:that.data.returnHid,mechanismId:that.data.mechanismId,position:that.data.position},function(res){
            console.log(res)
            that.setData({
                returnHid:res.data.returnHid,
                type:res.data.type,
                position:res.data.position,
                avgUnUsedRate:res.data.avgUnUsedRate,
                unUsedRate:res.data.unUsedRate,
                unUsedTimes:res.data.unUsedTimes,
                unUsedThreeDayCount:res.data.unUsedThreeDayCount,
                tableData:res.data.unUsedThreeDayCount
            })
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})